let stringType:string = "Hello world";
let numberType:number = 42;
let booleanType:boolean = true;

let numbers:number[] = [12,3,45];

let numberArray:Array<number> = [12,3,45];
let strings:string[] = [">>>>>","<<<<",">>>???"];


// 不想做类型检查的时候可以用any
let obj1:any = {x: 0};

obj1.foo();
obj1();
obj1.bar = 100;
obj1 = "100";
const n:number = obj1;

let myName:string = "Alice";
// 自动退到类型
let myName1 = "Alice";

function greet2(name:string) {
    console.log("Hello, " + name.toLowerCase() + "!!");
}

// greet2(43);

function getFavoriteNumber(): number {
    return 26;
}

async function getFavoriteNumber1(): Promise<number> {
    return 26;
}
// 匿名函数
const names = ["Alice", "Bob", "Eve"];
names.forEach(function(s) {
    console.log(s.toLowerCase());
})

names.forEach((s)=> {
    console.log(s.toLowerCase());
})